﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sgr.Sms
{
    /// <summary>
    /// 短信发送结果
    /// </summary>
    public class SmsResult
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Succeeded { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        public string? Error { get; set; }

        /// <summary>
        /// 创建成功结果
        /// </summary>
        public static SmsResult Success() => new() { Succeeded = true };

        /// <summary>
        /// 创建失败结果
        /// </summary>
        public static SmsResult Failure(string error) => new() { Succeeded = false, Error = error };
    }
}